﻿using Newtonsoft.Json;
using System;

namespace PivotData
{
    [Serializable]
    public class FacetUri : FacetAbsBase
    {
        /// <summary>
        /// The data that is stored in this facet
        /// </summary>
        [JsonProperty]
        public Uri URI;

        /// <summary>
        /// The link string to be used for the URI.
        /// </summary>
        [JsonProperty]
        public string LinkString;

        /// <summary>
        /// Check that the values of these guys are equal
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            var f = obj as FacetUri;
            if (f == null)
                return false;

            return f.Name == Name && f.URI == URI && f.LinkString == LinkString;
        }
    }
}
